Method and apparatus for flexible and efficient analytics in a network switch

ABSTRACT

Embodiments of the present invention relate to a centralized network analytic device, the centralized network analytic device efficiently uses on-chip memory to flexibly perform counting, traffic rate monitoring and flow sampling. The device includes a pool of memory that is shared by all cores and packet processing stages of each core. The counting, the monitoring and the sampling are all defined through software allowing for greater flexibility and efficient analytics in the device. In some embodiments, the device is a network switch.

FIELD OF INVENTION

The present invention relates to traffic analytics in a high speed network switch. More particularly, the present invention relates to method and apparatus for flexible and efficient analytics in a network switch, wherein the analytics include counting, rate monitoring and flow sampling.

BACKGROUND OF THE INVENTION

Software defined networks (SDN) has emerged, and open flow is one of the prominent representatives. Incoming packets go through series of table searches and match actions, and analytics. Good abstraction in network switches are of paramount importance as it allows for efficient usage of limited hardware resource, dealing with changing requirements, as well as simplicity of programming in the next higher level.

Counters, two-rate three-color rate monitors (policing) and flow sampling exists in prior art network switches. The prior art network switches use dedicated memory for each of these purposes. Particularly, these counters, rate monitors and samplers are accessible from certain fixed stages of an internal pipeline since each processing unit of the internal pipeline is predefined to perform designated tasks. Counters are used to count number of packets, or bytes of traffic in various conditions through the switch. Policing classifies packet through the switch into three different colors, namely, green, yellow or red, each of which may be associated with a different quality of service. Sampling samples a high speed flow of traffic into a lower speed stream and send to system CPU for additional processing or analyzing. Accordingly, the prior art network switches lack the flexibility to perform counting, traffic rate monitoring and flow sampling.

BRIEF SUMMARY OF THE INVENTION

Embodiments of the present invention relate to a centralized network analytic device, the centralized network analytic device efficiently uses on-chip memory to flexibly perform counting, traffic rate monitoring and flow sampling. The device includes a pool of memory that is shared by all cores and packet processing stages of each core. The counting, the monitoring and the sampling are all defined through software allowing for greater flexibility and efficient analytics in the device. In some embodiments, the device is a network switch.

In one aspect, a network switch is provided. The network switch includes at least one core that includes a plurality of pipeline stages. The network switch also includes an interface module including a unified request and response interface for communicating with each of the plurality of pipeline stages of the at least one core to receive requests therefrom. The network switch also includes a common memory pool coupled with the interface module and for processing the requests in parallel.

In some embodiments, the network switch also includes an analytics module for performing multiple parallel network analytics. The analytics module includes a plurality of client interfaces, an interconnect and a plurality of analytics banks. The plurality of client interface and the plurality of analytics banks are interconnected through the interconnect.

In some embodiments, each of the plurality of client interfaces is programmable to map to one or more of the plurality of analytics banks.

In some embodiments, memories from the common memory pool are separated into the plurality of analytics banks.

In some embodiments, the plurality of analytics banks is homogenous.

In some embodiments, each of the plurality of analytics banks includes an on-chip memory, such as a 272-bit wide and 512-entry deep on-chip memory.

In some embodiments, the plurality of client interfaces is similarly configured.

In some embodiments, each of the plurality of client interfaces includes a request interface for receiving requests and a response interface for sending responses. The request interface classifies each request and determines a target analytics bank and a target entry address within the target analytics bank that the request should target. The target analytics bank is one of the plurality of analytics bank. The request is sent to the interconnect to be routed to the target analytics bank for processing.

In some embodiments, each of the plurality of client interfaces is configured as one of four modes: counter, policing, policing with billing counters and sampling.

In some embodiments, the counting mode, the policing mode and the sampling mode are each allocated at bank granularity, and wherein the policing with billing counters mode is allocated at granularity of a pair of analytics banks. For example, analytics bank 2*i is for policing and the immediate next analytics bank 2*i+1 is for corresponding billing counters.

In some embodiments, when an analytics bank is in counting mode, the analytics bank is configured in one of four configurations, wherein modification operations are different for each of the configurations. The modification operations include incrementing the value of an events field by one for each incoming request, incrementing the value of a sum field by the value of the incoming request, and incrementing the value of a sumOfSquare field by the square of the value of the incoming request. Standard deviation of network activities is calculated by subtracting the square of average of sum from the average of sumOfSquare. No result response goes out of the analytics bank, wherein counter values are stored in memory of the analytics bank. In some embodiments, a fifth configuration is only used for policing with billing counter mode.

In some embodiments, when an analytics bank is in policing mode, the analytics bank performs a two-rate three color rate monitoring function. Every row of the analytics bank has one policer, wherein the policer has configuration and internal state. The policer returns a color of a packet to one of the client interfaces that originated the packet. In some embodiments, when the originating client interface is configured as policing with billing counters mode, the analytics bank is sends a counter request to its immediate next analytics bank to calculate byte count for a packet in each color.

In some embodiments, when an analytics bank is in sampling mode, the analytics bank supports N/M random sampling, wherein N contiguous events are sampled in every M events interval. A response is returned to the originating client interface for each request.

In another aspect, an analytics bank is provided. The analytics bank includes at least three processing units and a memory bypass module.

The at least three processing units includes a counter processing unit, a policing processing unit and a sampling processing unit. The policing processing unit is able to push a request to another analytics bank for byte counting of color, wherein the another analytics bank is immediate next to the analytics bank

The memory bypass module hides memory read latency. In particular, output data of the memory bypass module is directed to the counter processing unit, the policing processing unit or the sampling processing unit.

In some embodiments, when the analytics bank is in counter mode, the counter processing unit is configured to calculate sum of square, summation and event count for network activity statistical analysis. In some embodiments, the counter processing unit is configured to calculate standard deviation of network activities.

In yet another aspect, a method of a network switch is provided. The method includes partitioning a pool of shared memories into a plurality of homogeneous analytics banks, and programmably configuring each of a plurality of client interfaces as one of four modes: counter, policing, policing with billing counters or sampling. The method also includes programmably mapping each of the plurality of client interfaces to a subset of the plurality of homogeneous analytics banks, and programmably assigning each of the plurality of homogeneous analytics banks as one of three modes: counter, policing or sampling. The method also includes parallel processing multiple requests received at the plurality of client interfaces.

In some embodiments, the parallel processing multiple requests step includes, for each of the multiple requests, determining a target analytics bank and a target entry address within the target analytics bank.

The parallel processing multiple requests step also includes, when the target analytics bank is in the counter mode, the target analytics bank performing at least one operation, such as sum of square, summation or event count. The standard deviation of network activities can also be calculated. A counter entry within the target analytics bank based on the target entry address is determined and a memory row within the target analytics bank is also determined to store counter values.

The parallel processing multiple requests step also includes, when the target analytics bank is in the policing mode, the target analytics bank performing a two-rate three-color rate monitoring function. The target analytics bank returns a color of a packet to an originating client interface of the packet. If configured as policing with billing counters, then the target analytics bank sends a counter request to an immediate next analytics bank for calculating byte count for the packet in each color.

The parallel processing multiple requests step can also include, when the target analytics bank is in the sampling mode, the target analytics bank supporting N/M random sampling, wherein N contiguous events are sampled in every M events interval. The target analytics bank returns a response to an originating client interface of the request.

BRIEF DESCRIPTION OF THE DRAWINGS

The foregoing will be apparent from the following more particular description of example embodiments of the invention, as illustrated in the accompanying drawings in which like reference characters refer to the same parts throughout the different views. The drawings are not necessarily to scale, emphasis instead being placed upon illustrating embodiments of the present invention.

FIG. 1 illustrates an exemplary aspect of a network switch according to an embodiment of the present invention.

FIG. 2 illustrates an analytics module according to an embodiment of the present invention.

FIG. 3 illustrates a policing analytics bank memory organization for policing with billing counters mode according to an embodiment of the present invention.

FIG. 4 illustrates a sampling analytics bank memory organization according to an embodiment of the present invention.

FIG. 5 illustrates a block diagram of an analytics bank according to an embodiment of the present invention.

FIG. 6 illustrates a method of a network switch according to an embodiment of the present invention.

DETAILED DESCRIPTION OF THE INVENTION

In the following description, numerous details are set forth for purposes of explanation. However, one of ordinary skill in the art will realize that the invention can be practiced without the use of these specific details. Thus, the present invention is not intended to be limited to the embodiments shown but is to be accorded the widest scope consistent with the principles and features described herein.

Embodiments of the present invention relate to a centralized network analytic device, the centralized network analytic device efficiently uses on-chip memory to flexibly perform counting, traffic rate monitoring and flow sampling. The device includes a pool of memory that is shared by all cores and packet processing stages of each core. The counting, the monitoring and the sampling are all defined through software allowing for greater flexibility and efficient analytics in the device. In some embodiments, the device is a network switch. Other networking devices are contemplated.

FIG. 1 illustrates an exemplary aspect of a network switch 100 according to an embodiment of the present invention. The network switch 100 includes one or more cores 105 and a traffic manager 110. Each core 105 typically includes a plurality of pipeline stages. The plurality of pipeline stages includes a plurality of packet processing units 115 and at least one packet modifier 120. All processing units 115, 120 in the one or more cores 105 communicate with an interface module 125 through a unified request and response interface (see FIG. 2). The interface module 125 is coupled with a common memory pool 130 for request processing.

FIG. 2 illustrates an analytics module 200 according to an embodiment of the present invention. The analytics module 200 is typically a part of a network switch, such as the network switch 100 of FIG. 1. The analytics module 200 includes a plurality of client interfaces 205, an interconnect 210 and a plurality of analytics banks 215. The plurality of client interfaces 205 and the plurality of analytics banks 215 are interconnected through the on-chip network 210. Each client interface 205 is programmable to map to one or more of the plurality of analytics banks 215. The memories from the common memory pool 130 of FIG. 1 are typically separated into the plurality of analytics banks 215. In some embodiments, the plurality of analytics banks 215 is homogenous in that each analytics bank 215 contains the same number of memories as the other analytics banks 215. In some embodiments, each analytics bank 215 includes a 272-bit wide and 512-entry deep on-chip memory, although other memory sizes are possible.

In some embodiments, the client interfaces 205 are similarly configured. Each client interface 205 typically has a request interface 205 a and a response interface 205 b. The request interfaces 205 a of the client interfaces 205 are configured to receive incoming requests, which each includes a request address and a request value, from packet processing units and the response interfaces 205 b of the client interfaces 205 are configured to send responses to the packet processing units. In some embodiments, the packet processing units correspond with the cores 105 of FIG. 1. Each request interface 205 a typically classifies each incoming request and determines a target analytics bank and a target entry address within in the target analytics bank that the request should target. The target analytics bank is typically one of the one or more of the plurality of analytics banks 215 that the client interface 205 is mapped to. The request is then sent to the on-chip network 210 to be routed to the target analytics bank 215 for processing. Each request typically has no more than one response (e.g., either no responses or exactly one response).

Table 1 illustrates a table configuration for each client interface 205. Each client interface 205 can be configured as one of four possible modes (i.e., counting, policing, policing with billing counters, and sampling), as indicated by the mode field.

TABLE 1 Config. Name Size Description mode 4 Counter, policing, policing with billing counters or sampling mode anaBankStart 6 Starting analytics bank for the table anaBankEnd 6 End analytics bank for the table entryPerBank 3 In unit of 512-entry. Used for address decoding of multi-bank tables. Each analytics bank can be configured to host different amount of table entries.

As discussed above, while the sizes the analytics banks 215 are the same, the connection between the client interfaces 205 and the analytics banks 215 is programmable through software. In particular, the mapping of each client interface 205 to a subset of the analytics banks 215 can be defined through software. In one extreme, a client interface 205 can use one analytics bank 215. In an opposite extreme, a client interface 205 can use all of the analytics banks 215. It is possible for two or more client interfaces 205 to use the same subset of analytics banks 215.

Each client interface 205 is able to utilize one or more analytics banks 215, as specified by the anaBankStart and anaBankEnd fields, wherein the analytics banks 215 therebetween are typically contiguous. The entryPerBank field indicates a number of entries that reside in each analytics bank 215. The entryPerBank field is used to calculate the target analytics bank 215 for each request. In some embodiments, an integer part of an incoming request address divided by the number of entries per analytics bank 215 (i.e., entryPerBank) becomes the target analytics bank ID, and the least significant bits of the incoming request address are used to generate a target entry address within that analytics bank 215.

In some embodiments, one or more pairs of the analytics banks 215 is connected for policing mode with billing counters. In other words, while the counter mode, the policing mode and the sampling mode are each allocated at bank granularity, policing with billing counters is allocated at granularity of pair of analytics banks 215 such that analytics bank 2*i is for policing and the immediate next analytics bank 2*i+1 is for corresponding billing counters.

Counting

Table 2 lists supported counting configurations of an analytics bank 215 in the counter mode. In the counter mode, an analytics bank 215 can be configured in one of four different configurations: A, B, C and D.

TABLE 2 Logical Entry Modification Mode Width Fields Operation A 136 bits  54-b sumOfSquare sumOfSquare += value² 46-b sum sum += value 36-b events events += 1 B 68 bits 38-b sum sum += value 30-b events events += 1 C 34 bits 34-b events events += 1 D 17 bits 17-b events events += 1 P 246 bits  46-b red_sum 36-b red_events 46-b yellow_sum 36-b yellow_events 46-b green_sum 36-b green_events

Modification operations are different for each of the counter mode configurations. In counter mode configuration A, a counter entry contains three fields: sumOfSquare, sum and events. The value of the events field is incremented by one for each incoming request. The value of the sum field is incremented by the value of the incoming request. The value of the sumOfSquare field is incremented by the square of the value of incoming request. As such, a higher level application could use this counter mode configuration A to derive the standard deviation by subtracting the square of average of sum (i.e., sum/events) from the average of sumOfSquare (sumOfSquare/events). The standard deviation enables additional statistics analysis of the network switch. Counter mode configurations B, C, D and P are similarly organized as the counter mode configuration A. In some embodiments, the counter mode configuration P is only used for policing with billing counters mode and is thus not visible to the client interfaces 205 of FIG. 2. Policing with billing counters are discussed below.

As shown in Table 2, each counter entry is less than the memory width. The least significant bits of the target entry address are used to select the counter entry within a memory, while the most significant bits are used to select the memory row within the analytics bank. There is typically no result response for the counter mode. In other words, no response goes out from the analytics bank. Rather, counter values are stored in memory of the analytics bank for system CPU to read.

Based on configuration of the analytics banks, each of the fields will either stick at their maximum value or wrap around.

Policing

Each of the analytics banks 215 of FIG. 2 can be configured as a two-rate three-color marking policing analytics bank to perform a standard two-rate three-color rate monitoring function. Every row of the policing analytics bank has one policer or rate monitor. The terms policer and rate monitor are used interchangeably herein. The policer classifies each packet as one of three colors: red, yellow and green. A packet is marked red if it exceeds a peak rate. Otherwise, the packet is marked either yellow or green depending on whether the packet exceeds or does not exceed a committed rate.

Each policer has its own configuration and an internal state. Typically, the internal state is in the upper half of the policer, while the configuration is in the lower half of the policer. The configuration typically includes the two rates, and the state typically includes what the current rate is. The policer returns the color of a packet to the originating client interface.

Policing with billing counters includes an even number of analytics banks, wherein analytics bank 2*i is for policing and analytics bank 2*i+1 is for the associated billing counters. FIG. 3 illustrates a policing analytics bank memory organization 300 for policing with billing counters mode according to an embodiment of the present invention. As shown in FIG. 3, when the originating client interface is configured as policing with billing counters mode, analytics bank 305 configured in policing mode sends a counter request to its immediate next analytics bank 310 configured in counter mode configuration P. As such, byte count for packet in each color is calculated at the analytics bank 310.

Sampling

Table 3 lists supported sampling configurations of an analytics bank 215 in the sampler mode. Each analytics bank 215 is configured to support N/M random sampling, where N contiguous events are sampled in every M events interval. Within each interval, the sampled events start from a random offset. In this mode, each sampler has an associated configuration, as shown in Table 3. M is calculated as M base*2^(M) ^(—) ^(expo).

TABLE 3 Field Width Description N 8 M_base 8 M = M_base * 2^(M) _(—) ^(expo), M ceiled at 255 * 2¹² M_expo 4 Subtotal 20

Table 4 illustrates sampler states for each individual sampler in the analytics bank.

TABLE 4 Field Width Description total_cnt 64 Total events that could have been sampled interval_event_cnt 20 Warps around at M, regardless of clearOnRead and/or wraparound configuration interval_smp_start 20 Which event to start sampling, updated every N event Subtotal 104

As shown in Table 4, the total_cnt field records total number of events that has been sampled. The total_cnt field is read and cleared from the CPU such that the system can obtain important statistics about the sampler. It also keeps intermediate state to count the start and end of the current sampling interval, as interval_event_cnt, at the beginning of each interval, a random sampling start point is decided, so events interval_smp_start through interval_smp_start+N−1 are sampled. A sample or non-sample response is returned to the originating client interface for each request.

FIG. 4 illustrates a sampling analytics bank memory organization 400 according to an embodiment of the present invention. As shown in FIG. 4, two sample entries reside in on memory row, with the least significant bit of target entry address being used to select one of these two entries while all other bits are used to select the target memory row.

Analytics Bank

FIG. 5 illustrates a block diagram of an analytics bank 500 according to an embodiment of the present invention. The analytics bank 500 is similarly configured as the analytics bank 215. All operations for counter, policing and sampling can be classified as memory read-modify-write. Since there can be a read latency for memories, which can create a hazard, a memory bypass module 505 is used to hide the memory read latency. Output data of the memory bypass module 505 is directed to one of three processing units, namely a counter processing unit 520, a policing processing unit 510 or a sampling processing unit 515. As discussed above, the policing processing unit 510 is able to push request to its immediate next analytics bank (not illustrated) for byte counting of each color.

FIG. 6 illustrates a method 600 of a network switch, such as the network switch 100 of FIG. 1, according to an embodiment of the present invention. As discussed above, the network switch 100 includes an interface module and a pool of shared memories. The interface module typically includes a plurality of client interfaces. Each of the client interfaces includes a request interface for receiving requests and a response interface for sending responses.

At a step 605, where the pool of shared memories are partitioned into a plurality of homogeneous analytics banks. In some embodiments, each of the homogeneous analytics banks includes a 272-bit wide and 512-entry deep on-chip memory.

At a step 610, each of a plurality of client interfaces is programmably configured as one of four modes: counter, policing, policing with billing counters or sampling.

At a step 615, each of the plurality of client interfaces is programmably mapped to a subset of the plurality of homogeneous analytics banks. In one extreme, a client interface is mapped to a single analytics bank. In an opposite extreme, a client interface is mapped to all of the analytics banks.

At a step 620, each of the plurality of homogeneous analytics banks is programmably assigned as one of three modes: counter, policing or sampling.

At a step 625, multiple requests received at the plurality of client interfaces are processed in parallel. For each of the multiple requests, a target analytics bank is determined, as well as a target entry address within the target analytics bank.

When the target analytics bank is in the counter mode, the target analytics bank performs at least one operation, such as sum of square, summation or event count. Standard deviation of network activities can also be calculated. A counter entry within the target analytics bank is determined based on the target entry address. A memory row within the target analytics bank is also determined to store counter values.

When the target analytics bank is in the policing mode, the target analytics bank performs a two-rate three-color rate monitoring function. The target analytics bank returns a color of a packet to an originating client interface of the packet. When the originating client interface is configured as policing with billing counters, the target analytics bank sends a counter request to an immediate next analytics bank for calculating byte count for the packet in each color.

When the target analytics bank is in the sampling mode, the target analytics bank supports N/M random sampling, wherein N contiguous events are sampled in every M events. The target analytics bank returns a response to an originating client interface of the request.

The network switch of the present invention differs from those in prior art, where a counter module, policing module, sampling module or all are fixated with a particular processing unit. In contrast to the prior art, counting, monitoring and sampling are all defined or programmed through software allowing for greater flexibility and efficient analytics in the network switch of the present invention.

One of ordinary skill in the art will realize other uses and advantages also exist. While the invention has been described with reference to numerous specific details, one of ordinary skill in the art will recognize that the invention can be embodied in other specific forms without departing from the spirit of the invention. Thus, one of ordinary skill in the art will understand that the invention is not to be limited by the foregoing illustrative details, but rather is to be defined by the appended claims. 

We claim:
 1. A network switch comprising: at least one core including a plurality of pipeline stages; an interface module including a unified request and response interface for communicating with each of the plurality of pipeline stages of the at least one core to receive requests therefrom; and a common memory pool coupled with the interface module and for processing the requests in parallel.
 2. The network switch of claim 1, further comprising an analytics module for performing multiple parallel network analytics, wherein the analytics module includes: a plurality of client interfaces; an interconnect; and a plurality of analytics banks.
 3. The network switch of claim 2, wherein the plurality of client interface and the plurality of analytics banks are interconnected through the interconnect.
 4. The network switch of claim 2, wherein each of the plurality of client interfaces is programmable to map to one or more of the plurality of analytics banks.
 5. The network switch of claim 2, wherein memories from the common memory pool are separated into the plurality of analytics banks.
 6. The network switch of claim 2, wherein the plurality of analytics banks is homogenous.
 7. The network switch of claim 2, wherein each of the plurality of analytics banks includes an on-chip memory.
 8. The network switch of claim 2, wherein the plurality of client interfaces is similarly configured.
 9. The network switch of claim 2, wherein each of the plurality of client interfaces includes a request interface for receiving requests and a response interface for sending responses.
 10. The network switch of claim 9, wherein the request interface classifies each request and determines a target analytics bank and a target entry address within the target analytics bank that the request should target, wherein the target analytics bank is one of the plurality of analytics bank.
 11. The network switch of claim 10, wherein the request is sent to the interconnect to be routed to the target analytics bank for processing.
 12. The network switch of claim 2, wherein each of the plurality of client interfaces is configured as one of four modes: counter, policing, policing with billing counters and sampling.
 13. The network switch of claim 12, wherein the counting mode, the policing mode and the sampling mode are each allocated at bank granularity, and wherein the policing with billing counters mode is allocated at granularity of a pair of analytics banks.
 14. The network switch of claim 13, wherein analytics bank 2*i is for policing and the immediate next analytics bank 2*i+1 is for corresponding billing counters.
 15. The network switch of claim 2, wherein when an analytics bank is in counting mode, the analytics bank is configured in one of four configurations, wherein modification operations are different for each of the configurations.
 16. The network switch of claim 15, wherein the modification operations include incrementing the value of an events field by one for each incoming request, incrementing the value of a sum field by the value of the incoming request, and incrementing the value of a sumOfSquare field by the square of the value of the incoming request.
 17. The network switch of claim 15, wherein standard deviation of network activities is calculated by subtracting the square of average of sum from the average of sumOfSquare.
 18. The network switch of claim 15, wherein no result response goes out of the analytics bank, wherein counter values are stored in memory of the analytics bank.
 19. The network switch of claim 15, wherein a fifth configuration is only used for policing with billing counter mode.
 20. The network switch of claim 2, wherein when an analytics bank is in policing mode, the analytics bank performs a two-rate three color rate monitoring function.
 21. The network switch of claim 20, wherein every row of the analytics bank has one policer, wherein the policer has configuration and internal state.
 22. The network switch of claim 20, wherein the policer returns a color of a packet to one of the client interfaces that originated the packet.
 23. The network switch of claim 21, wherein when the originating client interface is configured as policing with billing counters mode, the analytics bank is sends a counter request to its immediate next analytics bank to calculate byte count for a packet in each color.
 24. The network switch of claim 2, wherein when an analytics bank is in sampling mode, the analytics bank supports N/M random sampling, wherein N contiguous events are sampled in every M events interval.
 25. The network switch of claim 24, wherein a response is returned to the originating client interface for each request.
 26. An analytics bank comprising: at least three processing units including: a counter processing unit; a policing processing unit, wherein the policing processing unit is able to push a request to another analytics bank for byte counting of color, wherein the another analytics bank is immediate next to the analytics bank; and a sampling processing unit; and a memory bypass module to hide memory read latency, wherein output data of the memory bypass module is directed to the counter processing unit, the policing processing unit or the sampling processing unit.
 27. The analytics bank of claim 26, wherein when the analytics bank is in counter mode, the counter processing unit is configured to calculate sum of square, summation and event count for network activity statistical analysis.
 28. The analytics bank of claim 27, wherein the counter processing unit is configured to calculate standard deviation of network activities.
 29. A method of a network switch comprising: partitioning a pool of shared memories into a plurality of homogeneous analytics banks; programmably configuring each of a plurality of client interfaces as one of four modes: counter, policing, policing with billing counters or sampling; programmably mapping each of the plurality of client interfaces to a subset of the plurality of homogeneous analytics banks; programmably assigning each of the plurality of homogeneous analytics banks as one of three modes: counter, policing or sampling; and parallel processing multiple requests received at the plurality of client interfaces.
 30. The method of claim 29, wherein the parallel processing multiple requests comprises, for each of the multiple requests: determining a target analytics bank and a target entry address within the target analytics bank; when the target analytics bank is in the counter mode, the target analytics bank performing at least one operation, wherein the at least one operation includes sum of square, summation or event count; when the target analytics bank is in the policing mode, the target analytics bank performing a two-rate three-color rate monitoring function; and when the target analytics bank is in the sampling mode, the target analytics bank supporting N/M random sampling, wherein N contiguous events are sampled in every M events interval.
 31. The method of claim 30, wherein when the target analytics bank is in the counter mode, the method further includes determining a counter entry within the target analytics bank based on the target entry address and determining a memory row within the target analytics bank to store counter values.
 32. The method of claim 31, further comprising calculating standard deviation of network activities.
 33. The method of claim 30, wherein when the target analytics bank is in the policing mode, the target analytics bank returning a color of a packet to an originating client interface of the packet.
 34. The method of claim 34, further comprising the target analytics bank sending a counter request to an immediate next analytics bank for calculating byte count for the packet in each color.
 35. The method of claim 30, wherein when the target analytics bank is in the sampling mode, the target analytics bank returning a response to an originating client interface of the request. 